package BitManipulation;

public class _421_MaximumXORofTwoNumbersinanArray {
    //solution 1:use ordinary loop method
    public int findMaximumXOR(int[] nums) {
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < nums.length; i++) {
            for(int j=i+1;j<nums.length;j++) {
                int temp = nums[i] ^ nums[j];
                if (temp > max) {
                    max = temp;
                }
            }
        }
        return max;
    }

    //solution 2:use trie tree,check Trie/_421_MaximumXORofTwoNumbersinanArray
}
